package com.test.pattern.adapter.object_adapter;

/**
 * @ClassName: Client
 * @description:
 * @author: Mr du
 * @create: 2024-02-20 21:58
 */
public class Client {

    public static void main(String[] args) {
        //创建计算机对象
        Computer computer = new Computer();
        //从sd卡中读取数据
        String msg = computer.readSD(new SDCardImpl());
        System.out.println(msg);
        System.out.println("==========================");
        //使用该电脑读取TF卡中数据
        //创建适配器类对象
        SDAdapterTF adapterTF = new SDAdapterTF(new TFCardImpl());
        String msg1 = computer.readSD(adapterTF);
        System.out.println(msg1);
    }
}
